{template 'common/header'}

<ul class="nav nav-tabs">
	<li {if $operation== 'post'}class="active"{/if}><a
		href="{php echo create_url('site/module/agentSetting', array('name' => 'mon_house', 'op' => 'post'));}">职业顾问添加</a></li>
	<li {if $operation== 'display'}class="active"{/if}><a
		href="{php echo create_url('site/module/agentSetting', array('name' => 'mon_house', 'op' => 'display'));}">职业顾问管理</a></li>

</ul>
{if $operation == 'post'}
<div class="main">
	<form action="" method="post" class="form-horizontal form"
		enctype="multipart/form-data">
		<input type="hidden" name="id" value="{$item['id']}" />
		<p/>
		<table class="tb">
		
		<tr>
		<th><label for="">职业顾问设置</label></th>
		<td>
		<div class="alert alert-block alert-new" >
		<table class="tb">

			<tr>
				<th><label for="">姓名</label></th>
				<td><input type="text" name="gname" class="span5"
					value="{$item['gname']}" /></td>
			</tr>
			
			
			<tr>
				<th><label for="">楼盘</label></th>
				<td>
				
					<select name="hid">
						{loop $houses $house}
								<option value="{$house['id']}" {if $house['id']==$item['hid'] }selected="selected"{/if}>{$house['title']}</option>
						{/loop}
					</select>
				</td>
			</tr>
			
			<tr>
				<th><label for="">联系电话</label></th>
				<td><input type="text" name="tel" class="span5"
					value="{$item['tel']}" /></td>
			</tr>
			
			<tr>
				<th><label for="">工作年限</label></th>
				<td><input type="text" name="workyear" class="span5"
					value="{$item['workyear']}" /></td>
			</tr>
			
			
			<tr>
				<th><label for="">头像</label></th>
				<td>{php echo tpl_form_field_image('headimgurl', $item['headimgurl']);}<span><font color="red">建议大小(640*400)</font></span></td>
			</tr>
			
		
		



			
		</table>
		
		</div>
		</td>
		</tr>
		
		
		
		
			<tr>
				<th></th>
				<td><input name="submit" type="submit" value="提交"
					class="btn btn-primary span3"> <input type="hidden"
					name="token" value="{$_W['token']}" /></td>
			</tr>
		</table>
	</form>
</div>
<script type="text/javascript">
<!--
	//kindeditor($('.richtext-clone'));
//-->
</script>




{elseif $operation == 'display'}
<div class="main">


	<form action="" method="post" id="house_form">
			
			<div>
			<table class="table tb">
				<tbody>
					<tr>
						
						<td>
							楼盘选择
							<select name="hid" id="hid">
								{loop $houses $house}
									<option value="{$house['id']}" {if $house['id']==$hid}selected="selected"{/if}>{$house['title']}</option>
								{/loop}
							</select>
							
						</td>
					</tr>
					
				</tbody>
			</table>
			</div>
	</form>


	<div style="padding: 15px;">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="min-width: 100px;">姓名</th>
					<th style="width: 180px;">头像</th>
					<th style="width: 180px;">电话</th>
					<th style="width: 180px;">工作年限</th>

					<th style="text-align: right; min-width: 300px;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $item}
				<tr>
					<td>
					
						{$item['gname']}
					
					</td>
				
				
					<td><img src="{php echo $this->img()}{$item['headimgurl']}"></td>
				
				
					<td>{$item['tel']}</td>
					
						<td>{$item['workyear']}</td>
					

					<td style="text-align: right; width: 400px">
				
						<a
						href="{php echo create_url('site/module/agentSetting', array('name' => 'mon_house', 'id' => $item['id'], 'op' => 'post'))}"
						title="编辑" class="btn btn-small"><i class="icon-edit"></i>编辑</a> <a
						href="{php echo create_url('site/module/agentSetting', array('name' => 'mon_house', 'id' => $item['id'], 'op' => 'delete'))}"
						onclick="return confirm('此操作不可恢复，确认删除？');return false;" title="删除"
						class="btn btn-small"><i class="icon-remove"></i>删除</a></td>
				</tr>
				{/loop}
			</tbody>

		</table>
		{$pager}
	</div>
</div>

<script>
	$("#hid").change(function(){
		
		$("#house_form").submit();
	});
</script>
{/if} {template 'common/footer'}
